/**
 * @file 线段树 单点修改 区间查询
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @brief
 * @version 1.0
 * @date 2022-05-14
 * @see https://www.luogu.com.cn/record/75750974
 *
 * @copyright Copyright (c) 2022
 *
 **/

#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;

int n;
struct FenwickTree {
  int t[N];
  int lowbit(int x) { return x & -x; };
  void add(int x, int v) {
    for (int i = x; i <= n; i += lowbit(i)) t[i] += v;
  };
  int query(int x) {
    int sum = 0;
    for (int i = x; i > 0; i -= lowbit(i)) sum += t[i];
    return sum;
  };
  int query(int l, int r) { return query(r) - query(l - 1); }
} xtree, ytree;
int xcnt[N], ycnt[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int q;
  cin >> n >> q;
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int x, y;
      cin >> x >> y;
      xcnt[x]++, ycnt[y]++;
      if (xcnt[x] == 1) xtree.add(x, 1);
      if (ycnt[y] == 1) ytree.add(y, 1);
    } else if (t == 2) {
      int x, y;
      cin >> x >> y;
      xcnt[x]--, ycnt[y]--;
      if (xcnt[x] == 0) xtree.add(x, -1);
      if (ycnt[y] == 0) ytree.add(y, -1);
    } else if (t == 3) {
      int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      cout << (xtree.query(x1, x2) == (x2 - x1 + 1) ||
                       ytree.query(y1, y2) == (y2 - y1 + 1)
                   ? "Yes\n"
                   : "No\n");
    }
  }
}
